package com.umerclass.ui.anmo.three.adapter;

import android.content.Context;
import android.graphics.Color;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.bumptech.glide.RequestManager;
import com.umerclass.R;
import com.umerclass.bean.anmo.three.DeviceBean;
import com.umerclass.bean.anmo.three.DeviceSetBean;
import com.umerclass.frame.ui.recycleview.adapter.RecyclerviewBasicAdapter;
import com.umerclass.frame.ui.recycleview.base.ViewHolder;
import com.umerclass.frame.ui.recycleview.listener.OptListener;

import java.util.List;

/**
 * Created by jack
 */

public class JiQiSetButtomAdapter extends RecyclerviewBasicAdapter<DeviceSetBean> {

    private OptListener optListener;
    private RequestManager glideRequestManager;
    private LinearLayout linear;

    public JiQiSetButtomAdapter(Context context, List datas, int layoutId, RequestManager glideRequestManager,
                                OptListener optListener) {
        super(context, datas, layoutId);
        this.optListener = optListener;
        this.glideRequestManager = glideRequestManager;
    }

    public JiQiSetButtomAdapter(Context context, List datas, int layoutId, OptListener optListener) {
        super(context, datas, layoutId);
        this.optListener = optListener;
    }

    @Override
    public void convert(ViewHolder holder, final DeviceSetBean bean, final int position) {
        TextView tv_taocan = holder.getView(R.id.tv_taocan);
        TextView tvMoneyOne = holder.getView(R.id.tvMoneyOne);
        TextView tvMoneyTwo = holder.getView(R.id.tvMoneyTwo);
        TextView tvStart = holder.getView(R.id.tvStart);
        TextView tvGaiBian = holder.getView(R.id.tvGaiBian);
        tvMoneyOne.setText(""+bean.getPrice());
        tvMoneyTwo.setText(""+bean.getTotalNum());
        tv_taocan.setText(bean.getName());
        tvStart.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                optListener.onOptClick(v,position);
            }
        });
        tvGaiBian.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                optListener.onOptClick(v,position);
            }
        });
    }

}
